import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
	state: {
		baseUrl:"https://www.baijixing.com.cn/api/",
		// baseUrl: "http://192.168.10.13:8084/api/",
		// 线上域名
		// baseUrl:"http://192.168.10.4:8084/api/",
		// baseUrl:"http://192.168.10.2:8084/api/",
		// baseUrl:"http://192.168.2.116:8084/api/",
		// baseUrl:"http://47.108.56.194:8884/api/",
		// 本地
		// baseUrl:"http://192.168.2.206:8084/api/",
		url_1: "https://admin.jjdaojia.com/api/xieyi/yulan/1",
		url_2: "https://admin.jjdaojia.com/api/xieyi/yulan/2",
		url_3: "https://admin.jjdaojia.com/api/xieyi/yulan/3",
		url_5: "https://admin.jjdaojia.com/api/xieyi/yulan/5",
		token: "",
		isLogin: false,
		jsonCode: "",
		sysInfo: null,
		lat: "",
		lng: "",
		address: '', //用户地址
		ip: "",
		mood: null,
		itemMood: null,

		orderType: 'hospital_care'
	},
	mutations: {
		setType(state, type) {
			state.orderType = type
			console.log(state.orderType)
		},
		setToken(state, token) {
			state.token = token;
			//console.log("启动获取到token"+token)
			if (state.token != '' && state.token != undefined) {
				state.isLogin = true;
				uni.setStorageSync("token", token);
			} else {
				state.isLogin = false;
				uni.removeStorageSync("token")
			}
			//console.log("state.isLogin"+state.isLogin)
		},
		setLat(state, lat) {
			state.lat = lat
			uni.setStorageSync("lat", lat);
		},
		setLng(state, lng) {
			state.lng = lng
			uni.setStorageSync("lng", lng);
		},
		setAddress(state, address) {
			state.address = address
			uni.setStorageSync("address", address);
		},
		setIp(state, ip) {
			state.ip = ip
			console.log(state)
			uni.setStorageSync("ip", ip);
		},
		setJsonCode(state, jsonCode) {
			state.jsonCode = jsonCode;
		},
		setSysInfo(state, sysInfo) {
			state.sysInfo = sysInfo;
		},
		setmood(state, sysInfo) {
			state.mood = sysInfo;
		},
		setitemMood(state, sysInfo) {
			state.itemMood = sysInfo;
		},
	},
	getters: {

	},
	actions: {

	}
})
export default store